// ProductCatalogManager.h: interface for the ProductCatalogManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PRODUCTCATALOGMANAGER_H__BAE0E502_DAD3_4190_A161_1AD69F17AD54__INCLUDED_)
#define AFX_PRODUCTCATALOGMANAGER_H__BAE0E502_DAD3_4190_A161_1AD69F17AD54__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ProductCatalog.h"
#include "ManagerTemplate.h"
#include "RecordsetPtrWrap.h"
#include "ProjectSubObject.h"

namespace JointSystem
{
	
	class AFX_EXT_CLASS ProductCatalogManager : public ManagerTemplate<CString, ProductCatalog>,
		public ProjectSubObject
	{
		enum{
			eREADALL,
				eNOREADALL};

	public:
		static ProductCatalogManager* Instance();
		static void DeleteInstance();
		
	public:
		ProductCatalogManager();
		
	public:
		void WriteSelectStandard(CString& strID,ProductCatalog* pSource);
		virtual ~ProductCatalogManager();
		ProductCatalog* GetProductCatalog( const CString& productCatalogID );
		_ConnectionPtr* DataSourceConnection();
		
		void GetProductCatalogNames( CStringArray& catalogNames, INT nStyle);
		void DeleteAll();
		BOOL GetAllCatalog();
	private:
		JointSystem::ProductCatalog* GetCatalog(DAWrapper::RecordsetPtrWrap& rs);

	private:
		_ConnectionPtr* m_Conn;
		INT m_nState;
	};
	
};

#endif // !defined(AFX_PRODUCTCATALOGMANAGER_H__BAE0E502_DAD3_4190_A161_1AD69F17AD54__INCLUDED_)
